Skip to content

Migrate from subscriptions-transport-ws to graphql-ws - #2548

Draft
MetRonnie wants to merge 3 commits into
cylc:masterfrom
MetRonnie:graphql-ws
Draft

Migrate from subscriptions-transport-ws to graphql-ws#2548
MetRonnie wants to merge 3 commits into
cylc:masterfrom
MetRonnie:graphql-ws

Conversation

@MetRonnie

@MetRonnie MetRonnie commented May 13, 2026

Copy link
Copy Markdown
Member

The subscriptions-transport-ws library is no longer maintained.

Closes #1028

Sibling: cylc/cylc-uiserver#821

Check List

  • I have read CONTRIBUTING.md and added my name as a Code Contributor.
  • Contains logically grouped changes (else tidy your branch by rebase).
  • Does not contain off-topic changes (use other PRs for other changes).
  • Tests are not needed
  • Changelog entry included
  • Docs not needed
  • If this is a bug fix, PR should be raised against the relevant ?.?.x branch.

@MetRonnie MetRonnie added this to the 3.0.0 milestone May 13, 2026
@MetRonnie MetRonnie self-assigned this May 13, 2026
@MetRonnie MetRonnie added dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code labels May 13, 2026
@MetRonnie
MetRonnie force-pushed the graphql-ws branch 3 times, most recently from 9751400 to 136e887 Compare June 4, 2026 15:14
@MetRonnie
MetRonnie force-pushed the graphql-ws branch 2 times, most recently from 428d292 to 2eb8e59 Compare June 30, 2026 10:31
@MetRonnie
MetRonnie requested a review from Copilot June 30, 2026 10:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the UI’s GraphQL subscription transport from the deprecated subscriptions-transport-ws stack to graphql-ws (GraphQL over WebSocket Protocol / graphql-transport-ws), updating both runtime wiring (Apollo link + subscription client) and local mock websocket handling.

Changes:

  • Replace subscriptions-transport-ws/WebSocketLink with graphql-ws + GraphQLWsLink, and update subscription-client creation accordingly.
  • Update mock websocket server message handling to the graphql-transport-ws protocol.
  • Remove cross-fetch polyfill usage from unit tests and update dependency manifests/lockfile + changelog entry.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
yarn.lock Drops deprecated subscription transport deps; adds graphql-ws; lockfile updated (incl. ws resolution change).
package.json Replaces subscriptions-transport-ws with graphql-ws; removes cross-fetch.
renovate.json Removes cross-fetch from renovate grouping (since it’s no longer used).
src/graphql/index.js Implements graphql-ws client creation + Apollo GraphQLWsLink wiring; keeps offline-state hooks.
src/services/workflow.service.js Updates JSDoc typedef for subscription client to graphql-ws Client.
src/services/mock/websockets.cjs Updates mock websocket protocol handling to graphql-transport-ws message types.
tests/unit/utils/graphql.spec.js Updates unit tests to Vitest imports and new subscription client creation.
tests/unit/utils/aotf.spec.js Removes cross-fetch polyfill import.
tests/unit/services/workflow.service.spec.js Removes cross-fetch polyfill import.
changes.d/2237.feat.md Changelog entry noting the protocol/subprotocol change.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/graphql/index.js
Comment on lines +35 to 38
it('creates a subscription client', () => {
const subscriptionClient = createSubscriptionClient('ws://localhost:12345')
expect(subscriptionClient.on).toBeTypeOf('function')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace subscriptions-transport-ws with graphql-ws

2 participants